<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8"/>
    <title>修改</title>
    <link href="__STATIC__/component/pear/css/pear.css" rel="stylesheet"/>
</head>
<body class="childrenBody {:dialog_css()}">
<form class="layui-form" action="{:url('edit')}" method="post">
    <input type="hidden" name="id" value="{$vo.id}"/>
    <div class="layui-form-item">
        <label class="layui-form-label layui-form-item-required">权限名</label>
        <div class="layui-input-block">
            <input type="text" name="title" lay-verify="required" placeholder="权限名(中文)" value="{$vo.title}" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label layui-form-item-required">控制器</label>
        <div class="layui-input-block">
            <input type="text" name="controller" lay-verify="required" placeholder="控制器(英文)" value="{$vo.controller}" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label layui-form-item-required">排序值</label>
        <div class="layui-input-block">
            <input type="number" name="sort" value="{$vo.sort}" min="0" step="10" lay-affix="number" placeholder="请输入排序值" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item layer-footer">
        <div class="layui-input-block">
            <button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="" lay-filter="save">
                <i class="layui-icon layui-icon-ok"></i>
                修改
            </button>
            <button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
                重置
            </button>
        </div>
    </div>
</form>
<script src="__STATIC__/component/layui/layui.js"></script>
<script src="__STATIC__/component/pear/pear.js"></script>
<script>
    layui.use(['form', 'aphp'], function () {
        let form = layui.form;
        let aphp = layui.aphp;
        form.on('submit(save)', function (data) {
            aphp.request.postForm(data, 0, function () {
                parent.layer.close(parent.layer.getFrameIndex(window.name));
                parent.layui.table.reload('authTable');
            });
            return false;
        });
    })
</script>
</body>
</html>